package src.com.zt.demo.digtal;

import java.text.DecimalFormat;

public class Demo {
    static void format(String pattern, double value){
        DecimalFormat df = new DecimalFormat(pattern);
        System.out.println(pattern);
        System.out.println(value);
        System.out.println(df.format(value));
    }

    public static void main(String[] args) {
        format("####",1234);   //调用静态方法
        format("###,###.##$",123456.789);
        format("#.###%",0.789);
        format("0.00\u2030",0.789);
    }
}
